/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package kotionokyurievna.gmail.com.genproj.logic;

import java.util.ArrayList;
import java.util.Collection;

/**
 *
 * @author Kateryna_Reznik
 */
public class FruitOperator {
   
    public <T> void copyAll ( Collection<? extends T> fromColl, Collection<T> toColl){
        toColl.addAll(fromColl);
    }
    
    public <T> Collection< ? extends Comparable<T>> copyAllBigger( Collection<? extends Comparable<T>> fromColl, T smallest){
       
       Collection< Comparable <T> > elements = new ArrayList<>();
       
       if ( smallest != null ){
            for ( Comparable<T> item : fromColl){
                if ( item.compareTo(smallest) > 0){
                       elements.add(item);
                }
          
            }
            return elements;
       }
       else{
           return fromColl;
       }
               
    }
}
